package ru.spbau.design.snmp.android.viewer.model;

public final class NetInterface {
	
	public NetInterface(NetNodeRouterInterface node, 
						SubNet subNet, 
						int inBytes, 
						int outBytes,
						Router router) {
		this.node = node;
		this.subNet = subNet;
		this.inBytes = inBytes;
		this.outBytes = outBytes;
		this.router = router;
	}
	
	public IPAddress getAddress() {
		return node.getAddress();
	}
	public SubNet getSubNet() {
		return subNet;
	}

	public String getName() {
		return node.getName();
	}

	public int getInBytes() {
		return inBytes;
	}

	public int getOutBytes() {
		return outBytes;
	}
	
	public Router getRouter() {
		return router;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((node == null) ? 0 : node.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		NetInterface other = (NetInterface) obj;
		if (node == null) {
			if (other.node != null)
				return false;
		} else if (!node.equals(other.node))
			return false;
		return true;
	}

	private final NetNode node;
	private final SubNet subNet;
	private final int inBytes;
	private final int outBytes;
	private final Router router;
}